12. Solution: For Loops Practice
Solution: Quick Brown Fox
Here is an efficient two lines of code, with the desired output. You could of course give your variable any name, it doesn't need to be
word
. But
word
makes sense here!
sentence = ["the", "quick", "brown", "fox", "jumped", "over", "the", "lazy", "dog"]
for word in sentence:
print(word)```
### Output:
txt
the
quick
brown
fox
jumped
over
the
lazy
dog
```
Solution: Multiples of 5
Here is our solution for this one:
for i in range(5, 35, 5):
print(i)```
### Output:
txt
5
10
15
20
25
30
```